import request from "../utils/request";

export function questionBankList(bean, currentPage, pageSize) {
    return request({
        url: "questionBank/questionBanks",
        method: 'get',
        params: {
            ...bean,
            currentPage, pageSize
        }
    })
}

export function getQuestionById(id) {
    return request({
        url: "questionBank/get/" + id,
        method: 'get',
    })
}

export function addQuestion(bean) {
    let questionBank = {...bean}
    return request({
        url: "questionBank/add",
        headers: {
            "Content-Type": "application/json",
        },
        method: 'post',
        data: questionBank
    })
}


export function updateQuestion(bean) {
    let questionBank = {...bean}
    return request({
        url: "questionBank/update",
        headers: {
            "Content-Type": "application/json",
        },
        method: 'post',
        data: questionBank
    })
}


export function deleteQuestionById(id) {
    return request({
        url: "questionBank/delete",
        method: 'post',
        data: {
            id
        }
    })
}

export function deleteQuestionByIds(ids) {
    return request({
        url: "questionBank/deletes",
        method: 'post',
        data: {
            ids
        }
    })
}

export function searchCount(keyWord) {
    return request({
        url: "questionBank/searchCount",
        method: 'get',
        params: {
            keyWord
        }
    })
}
